<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="resource/js/vue.js"></script>
</head>
<body>
<div id="app">
    <input v-model="msg">
    <button v-on:click="submit">submit</button>
</div>
<script>
    var vue = new Vue({
        el: '#app',
        data: {
            msg: 'hahahah'
        },
        methods: {
            submit: function () {
                this.$emit('submit', this.msg);
            }
        }
    })

    vue.$on('submit', function (msg) {
        alert(msg);
    })
</script>
</body>
</html>